/* eslint-disable no-param-reassign,no-else-return,global-require */
import Mock from 'mockjs';

Mock.mock('api.netMusic.com/category', (option) => {
  option.body = JSON.parse(option.body);
  if (option.body.type === 0) {
    return [
      { iconClass: require('../assets/icon/siren.png'), text: '私人FM' },
      { iconClass: require('../assets/icon/meirituijian.png'), text: '每日推荐', url: 'http://localhost:3000//recommend/resource' },
      { iconClass: require('../assets/icon/gedan.png'), text: '歌单' },
      { iconClass: require('../assets/icon/paihangbang.png'), text: '排行榜' }];
  } else {
    return [
      { iconClass: require('../assets/icon/type.png'), text: '电台分类' },
      { iconClass: require('../assets/icon/paihang.png'), text: '电台排行' },
      { iconClass: require('../assets/icon/nofree.png'), text: '付费精品' },
      { iconClass: require('../assets/icon/class.png'), text: '音乐课堂' }];
  }
});
